const resetState = () => {
  return {
    userName: ''
  }
}

const state = resetState()

const getters = {
  getUserName (state) {
    return state.userName
  }
}

const mutations = {
  RESET_STATE: (state) => {
    Object.assign(state, resetState())
  },
  SET_USERNAME: (state, userName) => {
    state.userName = userName
  }
}

const actions = {
  resetState({ commit }) {
    commit('RESET_STATE')
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
